package com.ruoyi.production.service.impl.stroma;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.production.domain.stroma.StromaPurchaseApply;
import com.ruoyi.production.mapper.stroma.StromaPurchaseApplyMapper;
import com.ruoyi.production.service.stroma.IStromaPurchaseApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 基质购买申请信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-12
 */
@Service
public class StromaPurchaseApplyServiceImpl implements IStromaPurchaseApplyService
{
    @Autowired
    private StromaPurchaseApplyMapper stromaPurchaseApplyMapper;

    /**
     * 查询基质购买申请信息
     *
     * @param stromaPurchaseApplyId 基质购买申请信息ID
     * @return 基质购买申请信息
     */
    @Override
    public StromaPurchaseApply selectStromaPurchaseApplyById(Long stromaPurchaseApplyId)
    {
        return stromaPurchaseApplyMapper.selectStromaPurchaseApplyById(stromaPurchaseApplyId);
    }

    /**
     * 查询基质购买申请信息列表
     *
     * @param stromaPurchaseApply 基质购买申请信息
     * @return 基质购买申请信息
     */
    @Override
    public List<StromaPurchaseApply> selectStromaPurchaseApplyList(StromaPurchaseApply stromaPurchaseApply)
    {
        return stromaPurchaseApplyMapper.selectStromaPurchaseApplyList(stromaPurchaseApply);
    }

    /**
     * 新增基质购买申请信息
     *
     * @param stromaPurchaseApply 基质购买申请信息
     * @return 结果
     */
    @Override
    public int insertStromaPurchaseApply(StromaPurchaseApply stromaPurchaseApply)
    {
        stromaPurchaseApply.setCreateTime(DateUtils.getNowDate());
        return stromaPurchaseApplyMapper.insertStromaPurchaseApply(stromaPurchaseApply);
    }

    /**
     * 修改基质购买申请信息
     *
     * @param stromaPurchaseApply 基质购买申请信息
     * @return 结果
     */
    @Override
    public int updateStromaPurchaseApply(StromaPurchaseApply stromaPurchaseApply)
    {
        stromaPurchaseApply.setUpdateTime(DateUtils.getNowDate());
        return stromaPurchaseApplyMapper.updateStromaPurchaseApply(stromaPurchaseApply);
    }

    /**
     * 批量删除基质购买申请信息
     *
     * @param stromaPurchaseApplyIds 需要删除的基质购买申请信息ID
     * @return 结果
     */
    @Override
    public int deleteStromaPurchaseApplyByIds(Long[] stromaPurchaseApplyIds)
    {
        return stromaPurchaseApplyMapper.deleteStromaPurchaseApplyByIds(stromaPurchaseApplyIds);
    }

    /**
     * 删除基质购买申请信息信息
     *
     * @param stromaPurchaseApplyId 基质购买申请信息ID
     * @return 结果
     */
    @Override
    public int deleteStromaPurchaseApplyById(Long stromaPurchaseApplyId)
    {
        return stromaPurchaseApplyMapper.deleteStromaPurchaseApplyById(stromaPurchaseApplyId);
    }
}
